//
//  QuotationTableCell.m
//  Trading365
//
//  Created by Jason on 12-2-14.
//  Copyright (c) 2012年 dhc. All rights reserved.
//

#import "InfoEditCell.h"
#import "InfoType.h"


@implementation InfoEditCell
@synthesize labName;
@synthesize textValue;
@synthesize cellButton;
@synthesize row;


- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        // Initialization code
    }
    return self;
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated
{
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

- (void)dealloc {
    [labName release];
    [textValue release];
    [cellButton release];
    [super dealloc];
}

- (IBAction)cellButtonTap:(id)sender {
//    NSLog(@"cellButtonTap");
}

- (IBAction)textFieldDone:(id)sender {
    [textValue resignFirstResponder];
}

- (IBAction)textFieldDidEndEditing:(UITextField *)textField
{
    if ([[InfoType share] GetFlagInfoType] == INFO_TYPE_CUSTOMER_CONTACT_ADD)
    {
        if (row == 1)
            [[[InfoType share] GetTranValueDict] setObject:[NSString stringWithFormat:@"%@",textValue.text] forKey:INFO_NAME_CUSTOMER_CONTACT_NAME];
        if (row == 2)
            [[[InfoType share] GetTranValueDict] setObject:[NSString stringWithFormat:@"%@",textValue.text] forKey:INFO_NAME_CUSTOMER_CONTACT_TEL];
        if (row == 3)
            [[[InfoType share] GetTranValueDict] setObject:[NSString stringWithFormat:@"%@",textValue.text] forKey:INFO_NAME_CUSTOMER_CONTACT_MAIL];
        if (row == 4)
            [[[InfoType share] GetTranValueDict] setObject:[NSString stringWithFormat:@"%@",textValue.text] forKey:INFO_NAME_CUSTOMER_CONTACT_REMARKS];
    }

    if ([[InfoType share] GetFlagInfoType] == INFO_TYPE_CHANCE_ADD)
    {
        [[[InfoType share] GetTranValueDict] setObject:[NSString stringWithFormat:@"%@",textValue.text] forKey:INFO_NAME_CHANCE_NAME];
    }
//    NSLog(@"textFieldDidEndEditing:GetTranValueDict(%d)=%@",row,[[[InfoType share] GetTranValueDict] objectForKey:[NSString stringWithFormat:@"%d",row]]);
    
}

@end
